<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
    <meta name="web-experience-app/config/environment" content=""/>

    <link integrity="" rel="stylesheet" href="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/stylesheets/web-app1.1.2.css">

    <title th:text="${appInfo.appName}">‎</title>
    <link rel="icon" href="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/portal/img/favicon.ico" type="images/x-icon">
    <link rel="stylesheet" href="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/stylesheets/ui1.1.2.css"/>
    <link rel="stylesheet" href="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/stylesheets/ui.progress-bar.css"/>
    <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"/>
</head>
<body class="has-js ember-application has-touch">
<div id="ember-app">

    <div class="ember-view" id="ember168">

        <main class="selfclear is-app-theme">
            <div id="ember227" class="animation-wrapper is-visible ember-view">
                <div id="ember228" class="ember-view">
                    <div class="l-content-width we-banner" role="alert">
                        <p class="we-banner__copy">只能在iOS设备上获取此App，只能在Safari浏览器下安装。</p>
                    </div>
                </div>

                <div id="ember229" class="ember-view">
                    <section id="ember230" class="l-content-width section section--hero product-hero ember-view">
                        <div class="l-row">
                            <div class="product-hero__media l-column small-5 medium-4 large-3 small-valign-top">
                                <picture id="ember231"
                                         class="app-logo">
                                    <img th:src="@{${appInfo.fullIconPath}}"/>
                                </picture>
                            </div>

                            <div class="l-column small-7 medium-8 large-9 small-valign-top">
                                <header class="product-header app-header product-header--padded-start" role="banner">
                                    <h1 class="product-header__title app-header__title" th:text="${appInfo.appName}">
                                        <span class="badge badge--product-title" th:text="${appInfo.version}"/>
                                    </h1>
                                    <ul class="product-header__list app-header__list">
                                        <!---->
                                        <li class="product-header__list__item app-header__list__item--user-rating">
                                            <ul class="inline-list inline-list--mobile-compact">
                                                <li class="inline-list__item">
                                                    <figure aria-label="4.8（满分 5 分）" id="ember235"
                                                            class="ember-view">
                                                        <figcaption class="star-rating__count">
                                                            4.8，1.8万个评分
                                                        </figcaption>
                                                    </figure>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                    <ul class="product-header__list app-header__list">
                                        <span>免费</span> <a class="course" href="#">视频教程</a>
                                    </ul>
                                    <!---->
                                    <div class="product-header__routes app-header__routes" id="button-bar">
                                        <p th:if="${appInfo.status == 1}" class="product-header__routes__cta">
                                            <button th:if="${param.udid}"
                                                    class="we-button we-button--outlined we-button--external icon"
                                                    id="doResign">安装
                                            </button>
                                            <a th:unless="${param.udid}" id="mbconfigBtn"
                                               class="we-button we-button--outlined we-button--external icon"
                                               th:href="${appInfo.mbConfig}" target="_blank">安装</a>
                                        </p>

                                        <p th:unless="${appInfo.status == 1}" class="product-header__routes__cta">
                                            应用未上架
                                        </p>

                                    </div>

                                    <div id="progress_bar" class="ui-progress-bar ui-container" style="display:none;">
                                        <div class="ui-progress" style="width: 3%;display:none;">
                                            <span class="ui-label" style="display:none;">
                                                <b class="tip">处理中</b>
                                                <b class="value">3%</b>
                                            </span>
                                        </div>
                                    </div>
                                    <div id="install_tip" style="display: none;">
                                        <span>如果桌面图标是灰的，说明正在安装中，请稍等片刻.</span>
                                    </div>

                                </header>
                            </div>
                        </div>
                    </section>

                    <section class="l-content-width section section--bordered whats-new">
                        <div class="section__nav section__nav--small">
                            <h2 class="whats-new__headline">新内容</h2>
                        </div>
                        <div class="l-row whats-new__content">
                            <div class="l-column small-12 medium-3 large-4 small-valign-top whats-new__latest">
                                <div class="l-row">
                                    <time data-test-we-datetime="" datetime="2019-06-20T16:07:18.000Z"
                                          aria-label="2019年6月21日" class="">2019年6月21日
                                    </time>
                                    <p class="l-column small-6 medium-12 whats-new__latest__version">版本
                                        <span class="badge badge--product-title" th:text="${appInfo.version}"/>
                                    </p>
                                </div>
                            </div>
                            <div class="l-column small-12 medium-9 large-8 small-valign-top">
                                <div id="ember275"
                                     class="we-truncate we-truncate--multi-line we-truncate--interactive ember-view">

                                    <div data-clamp="" id="ember277" class="we-clamp ember-view" ismorertl="false"
                                         style="height: 90px; -webkit-mask: linear-gradient(0deg, rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 18.0001px, rgb(0, 0, 0) 18.0001px), linear-gradient(270deg, rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 16.4px, rgb(0, 0, 0) 52.4002px);">
                                        <p dir="ltr" data-test-bidi="">【全新内容】</p>
                                        <p dir="ltr" data-test-bidi="">1、画面升级</p>
                                        <p dir="ltr" data-test-bidi="">全新UI界面改版迭代，界面更时尚、更清晰</p>
                                        <p dir="ltr" data-test-bidi="">前期过场动画品质提升，场景品质提升</p>
                                        <br>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>

                    <section class="l-content-width section section--bordered">
                        <div class="section__nav">
                            <h2 class="section__headline">评分及评论</h2>
                        </div>
                        <div id="ember279" class="we-customer-ratings lockup ember-view">
                            <div class="l-row">
                                <div class="we-customer-ratings__stats l-column small-4 medium-6 large-4">
                                    <div class="we-customer-ratings__averages"><span
                                            class="we-customer-ratings__averages__display">4.8</span>（满分 5 分）
                                    </div>
                                    <div class="we-customer-ratings__count small-hide medium-show">1.8万 个评分</div>
                                </div>
                                <div class=" l-column small-8 medium-6 large-4">
                                    <figure class="comment-star-list">
                                        <div class="we-star-bar-graph__row">
                                            <div class="comment-star">
                                                <img src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/star.png"/>
                                                <div></div>
                                            </div>
                                            <div class="we-star-bar-graph__bar">
                                                <div class="we-star-bar-graph__bar__foreground-bar"
                                                     style="width: 86%;"></div>
                                            </div>
                                        </div>
                                        <div class="we-star-bar-graph__row">
                                            <div class="comment-star">
                                                <img src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/star.png"/>
                                                <div></div>
                                            </div>
                                            <div class="we-star-bar-graph__bar">
                                                <div class="we-star-bar-graph__bar__foreground-bar"
                                                     style="width: 6%;"></div>
                                            </div>
                                        </div>
                                        <div class="we-star-bar-graph__row">
                                            <div class="comment-star">
                                                <img src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/star.png"/>
                                                <div></div>
                                            </div>
                                            <div class="we-star-bar-graph__bar">
                                                <div class="we-star-bar-graph__bar__foreground-bar"
                                                     style="width: 4%;"></div>
                                            </div>
                                        </div>
                                        <div class="we-star-bar-graph__row">
                                            <div class="comment-star">
                                                <img src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/star.png"/>
                                                <div></div>
                                            </div>
                                            <div class="we-star-bar-graph__bar">
                                                <div class="we-star-bar-graph__bar__foreground-bar"
                                                     style="width: 3%;"></div>
                                            </div>
                                        </div>
                                        <div class="we-star-bar-graph__row">
                                            <div class="comment-star">
                                                <img src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/star.png"/>
                                                <div></div>
                                            </div>
                                            <div class="we-star-bar-graph__bar">
                                                <div class="we-star-bar-graph__bar__foreground-bar"
                                                     style="width: 1%;"></div>
                                            </div>
                                        </div>
                                    </figure>
                                    <p class="we-customer-ratings__count medium-hide">1.8万 个评分</p>
                                </div>
                            </div>
                        </div>
                        <div class="l-row l-row--margin-top medium-hide">

                        </div>
                    </section>

                    <section class="l-content-width section section--bordered">
                        <div class="l-row">
                            <div class="l-column small-12">
                                <h2 class="section__headline">信息</h2>
                                <dl class="information-list information-list--app medium-columns">
                                    <div class="information-list__item l-row">
                                        <dt class="information-list__item__term medium-valign-top l-column medium-3 large-2">
                                            大小
                                        </dt>
                                        <dd class="information-list__item__definition l-column medium-9 large-6"
                                            aria-label="56M">56M
                                        </dd>
                                    </div>
                                    <div class="information-list__item l-row">
                                        <dt class="information-list__item__term medium-valign-top l-column medium-3 large-2">
                                            类別
                                        </dt>
                                        <dd class="information-list__item__definition l-column medium-9 large-6">
                                            游戏
                                        </dd>
                                    </div>
                                    <div class="information-list__item l-row">
                                        <dt class="information-list__item__term medium-valign-top l-column medium-3 large-2">
                                            兼容性
                                        </dt>
                                        <dd id="ember319"
                                            class="we-truncate we-truncate--multi-line we-truncate--interactive ember-view information-list__item__definition l-column medium-9 large-6">

                                            <div data-clamp="" id="ember321" class="we-clamp ember-view"><p dir="ltr"
                                                                                                            data-test-bidi="">
                                                需要 iOS 9.0 或更高版本。与 iPhone、iPad 和 iPod touch 兼容。</p>
                                            </div>
                                            <!----></dd>
                                    </div>
                                    <!---->
                                    <div class="information-list__item l-row">
                                        <dt class="information-list__item__term medium-valign-top l-column medium-3 large-2">
                                            语言
                                        </dt>
                                        <dd id="ember323"
                                            class="information-list__item__definition l-column medium-9 large-6 we-truncate we-truncate--multi-line we-truncate--interactive ember-view">

                                            <div data-clamp="" id="ember325" class="we-clamp ember-view"><p dir="ltr"
                                                                                                            data-test-bidi="">
                                                中文</p>
                                            </div>
                                        </dd>
                                    </div>
                                    <div class="information-list__item l-row">
                                        <dt class="information-list__item__term medium-valign-top l-column medium-3 large-2">
                                            年龄分级
                                        </dt>
                                        <dd class="information-list__item__definition l-column medium-9 large-6">您必须年满
                                            17 周岁才能下载此 App。
                                        </dd>
                                    </div>
                                    <div class="information-list__item l-row">
                                        <dt class="information-list__item__term medium-valign-top l-column medium-3 large-2">
                                            Copyright
                                        </dt>
                                        <dd class="information-list__item__definition l-column medium-9 large-6">
                                            Copyright © 2015 Tencent. All Rights Reserved
                                        </dd>
                                    </div>
                                    <div class="information-list__item l-row">
                                        <dt class="information-list__item__term medium-valign-top l-column medium-3 large-2">
                                            价格
                                        </dt>
                                        <dd class="information-list__item__definition l-column medium-9 large-6">免费</dd>
                                    </div>
                                </dl>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </main>
    </div>
</div>
<div id="weixin-tip"><p><img
        src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/live_weixin.png" alt="微信打开"/></p>
</div>
<div class="mask-box step-tips" style="display:none">
    <div class="mask-bg"></div>
    <div class="mask-pop video-pop">
            <span class="mask-colsed"><img
                    src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/colsed.png" alt=""></span>
        <div class="ali-video">
            <div class="prism-player" id="J_prismPlayer"></div>
        </div>
    </div>
</div>

<div class="pc-panel" style="display: none;">
    <div class="pc-logo">
        <img th:src="@{${appInfo.fullIconPath}}">
    </div>
    <p th:text="${appInfo.appName}"></p>

    <img th:src="@{${appInfo.qrcodePath}}">
    <div class="info">请使用相机扫码下载</div>
</div>

<script src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/javascripts/jquery.js"
        type="text/javascript" charset="utf-8"></script>
<script src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/javascripts/progress1.1.2.js"
        type="text/javascript" charset="utf-8"></script>
<script charset="utf-8" type="text/javascript"
        src="https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"></script>
<script charset="utf-8" type="text/javascript"
        src="https://drools-sr.oss-cn-hangzhou.aliyuncs.com/javascripts/swiper.min.js"></script>

<script th:inline="javascript">

    var appId = [[${appInfo.id}]];
    var udid = [[${param.udid}]];
    var localUserAgent = navigator.userAgent.toLowerCase();
    var is_weixin = (function () {
        return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
    })();

    var version = null;
    if (localUserAgent.indexOf("like mac os x") > 0) {
        var r = (localUserAgent.match(/os [\d._]*/gi)+"").replace(/[^0-9|_.]/gi, "");
        if(r){
            version = r.split("_")[0];
        }
    }
    // var version = localUserAgent.match(/cpu iphone os (\d+)\_(\d+) like/);
    var player = new Aliplayer({
        id: 'J_prismPlayer',
        width: '250px',
        height: '541.761px',
        autoplay: false,
        //播放方式二：点播用户推荐
        vid: '8947480e3f4e4db2ac6505e2ea86c6df',
        cover: 'https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/cover.png',
        source: 'https://drools-sr.oss-cn-hangzhou.aliyuncs.com/imgs/14b45e8c-16b503055cb.mp4'
    }, function (player) {
    });

    $(document).ready(function () {
        if (is_weixin) {
            $("#weixin-tip").css('display', 'block');
        }

        $('.course').click(function () {
            $('.step-tips').show();
            swiperFn();
        });
        $('.mask-colsed').click(function () {
            $(this).parents('.mask-box').hide();
        });

        $("#mbconfigBtn").click(function () {
            if(version && version<12) {

            }else{
                setTimeout(getMobileConfig, 3000);
            }
        });

        $("#doResign").click(function () {
            $('#button-bar').hide();
            $.ajax({
                url: "/app/init/" + appId + "/" + udid[0],
                async: true,
                success: function (result) {
                    if (result && result.code == 0) {
                        $('#progress_bar').show();
                        $('#progress_bar .ui-progress').css('width', '%');
                        setTimeout(doPoll, 3000);
                    }
                }
            });
        });
        if(udid){
            setTimeout(autoResign, 500);
        }
    });

    function doPoll() {
        $.ajax({
            url: "/app/process/" + appId + "/" + udid[0],
            async: true,
            success: function (result) {
                if (result && result.code == 0) {
                    var signProcess = result.data;
                    $('#progress_bar .ui-progress').animateProgress(signProcess.process, function () {
                    });

                    if (signProcess.status == "processing") {
                        setTimeout(doPoll, 3000);
                    } else if (signProcess.status == "successed") {
                        var url = signProcess.plist;
                        location.href = "itms-services://?action=download-manifest&url=" + url;
                        setTimeout(showInstallProcess, 3000);
                    }
                }
            }
        });
    }

    function autoResign(){
        $("#doResign").click();
    }

    function getMobileConfig() {
        location.href = "https://drools-sr.oss-cn-hangzhou.aliyuncs.com/setup.mobileprovision";
    }

    function showInstallProcess() {
        $('#progress_bar .ui-progress').css('width', '0%');
        $('#progress_bar .ui-progress').animateInstallProgress(100, function () {
            $('.ui-label').html("下载完成，请在桌面查看");
            $("#install_tip").show();
            $('.ui-label').show();
        });
    }

    function swiperFn() {
        var swiper = new Swiper('.step-swiper', {
            pagination: '.step-swiper .swiper-pagination',
            paginationClickable: true,
            onSlideChangeEnd: function (swiper) {
                swiper.update();
            }
        });
    }

    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?39dac30f1e3ab1c01f791fab2fd95bdf";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();

</script>
</body>
</html>